function Big(obj){
    Object.assign(this,obj);
    this.init();
}
Big.prototype={
    constructor:Big,
    init:function(){
        // 会员名
        this.a1=/^[a-zA-Z\u4e00-\u9fa5]{5,20}$/
        // 密码
        this.a2=/^[0-9a-zA-Z，,。\.?\？；;'":‘’]{6,20}$/
        this.move();
    },
    move:function(){
        var that=this;
        this.inp1.addEventListener('input',(e)=>{
            if(this.inp1.value==''){
                this.inp1.nextElementSibling.innerHTML='请输入会员名';
                return
            }
            if(this.a1.test(this.inp1.value)){
                this.inp1.nextElementSibling.innerHTML='✅';
            }else{
                this.inp1.nextElementSibling.innerHTML='❌';
            }
        })
        this.inp1.addEventListener('focus',()=>{
            this.inp1.nextElementSibling.nextElementSibling.style.display='block';
        })
        this.inp1.addEventListener('blur',()=>{
            this.inp1.nextElementSibling.nextElementSibling.style.display='none';
        })
        this.inp2.addEventListener('input',(e)=>{
            if(this.inp2.value==''){
                this.inp2.nextElementSibling.innerHTML='请输入密码';
                return
            }
            if(this.a2.test(this.inp2.value)){
                var num=0;
                if(/[a-zA-Z]/.test(this.inp2.value)){
                    num++;
                    this.inp2.nextElementSibling.innerHTML='不能只是字母'
                }
                if(/[,，.。/、？?;；:：‘’''""“”]/.test(this.inp1.value)){
                    num++;
                    this.inp2.nextElementSibling.innerHTML='不能只是字符'
                }
                if(/\b/.test(this.inp2.value)){
                    num++;
                    this.inp2.nextElementSibling.innerHTML='不能只是数字'
                }
                if(num>=2){
                    this.inp2.nextElementSibling.innerHTML='✅';
                }           
            }else{
                this.inp2.nextElementSibling.innerHTML='❌';
            }

        })
        this.inp2.addEventListener('focus',()=>{
            this.inp2.nextElementSibling.nextElementSibling.style.display='block';
        })
        this.inp2.addEventListener('blur',()=>{
            this.inp2.nextElementSibling.nextElementSibling.style.display='none';
        })

        this.inp3.addEventListener('input',()=>{
            if(this.inp3.value==this.inp2.value){
                this.inp3.nextElementSibling.innerHTML='✅';
            }else{
                this.inp3.nextElementSibling.innerHTML='❌';
            }
        })

        

    }
}
new Big({
    box:document.querySelector('.box'),
    inp1:document.querySelector('.inp1'),
    inp2:document.querySelector('.inp2'),
    inp3:document.querySelector('.inp3'),
    inp4:document.querySelector('.inp4'),
    inp5:document.querySelector('.inp5'),
    mask:document.querySelectorAll('.mask')
})
// document.body.nextElementSibling